Overview:
Timing of a motion is one of the most important elements in animation. It
affects both physical and emotional meaning of the movement. Timing can
give the illusion of weight and size of an object, as well as the
emotional state of a character. For example, if a character pushes forward
a heavy object, he should do it much slower than pushing a light object.
Animators must figure out a good timing for the anticipation of an action,
the action itself, and the reaction to the action.
Walking is an interesting motion; no two people in the world walk the same. By watching a person's walk, you can interpret a massive amount of information right away. Is he old or young? Is he happy or sad? What is his financial position?
In this assignment, your goal is to make a basic walk cycle animation more
expressive in two different ways:
1. Using the Motion Capture code base
2. Using Maya
You need to think about how to add characteristics or emotions to the character by editing its motion. At the same time, it is very important to familiarize yourself with ASF/AMC files as well as the viewer code base for next project.
Deliverables:
Implementation :
1. Motion Capture Code Base:
Use this ASF file as the skeleton file.
Use this AMC file as the motion file.
You can explore and pick your own from the database, but you are required to submit
at least one video using this basic walk cycle.
Load .asf/.amc files into your program and try to manipulate the timing and the
movement of the character.
You can think about the following questions:
You can choose your best way to edit the motion:
Compiling the code:
If you want to use the amc viewer code as your starter code, you can get it from:
http://graphics.cs.cmu.edu/software/amc_viewer.r1806.tar.gz
To compile, you may also need to download ftjam:
http://sourceforge.net/projects/freetype/files/ftjam/2.5.2/ftjam-2.5.2-linux-i386-glibc6.tar.gz/download
Extract it and put it in your project's top-level directory.
Type "./jam" to compile the code.
Here's also description about ftjam:
http://freetype.sourceforge.net/jam/index.html
Running the code:
Make sure there is a "Skeleton.ASF" file with the AMC file in the
"dist/data" directory. Or you can specify where to load them.
A simple
camera control is provided. Use the left mouse button to rotate, middle
mouse button to zoom in/out, and the right mouse button to pan the camera.
Space bar can be used to Play/Play in slow motion/Pause. Tab key can be
used to toggle the camera movement.
Using the code:
Reading
===============
#include <Library/Library.hpp>
#include <Character/Character.hpp>
Library::init("my/data/folder");
for (unsigned int idx = 0; idx < Library::motion_count(); ++idx) {
Library::Motion const &m = Library::motion(idx);
for (unsigned int f = 0; f < m.frames(); ++f) {
Character::Pose my_pose;
m.get_pose(f, my_pose);
}
}
The function Library::init Scans the given directory for amc/afs files and loads them. You can retrieve these loaded files by calling
Library::motion(index) with 0 <= index <= Library::motion_count() .
Manipulating
============
Each motion represents the state of a character over time. The basic representation of this state is a Character::Pose.
You can get a pose from a motion by calling:
m.get_pose(20, my_pose); //get pose at frame 20 into my_pose
m.get_local_pose(20, my_local_pose); //get pose -- without root translation -- into my_local_pose.
Poses can be transformed into two other representations, Angles and WorldBones.
Angles
---------
#include <Character/Character.hpp>
Character::Angles angles;
my_pose.to_angles(angles);
//...modify angles...
angles.to_pose(my_pose);
Angles are raw joint-angle data, or basically what you would get if you just read the amc file yourself.
WorldBones
------------
#include <Character/pose_utils.hpp>
Character::WorldBones wb;
get_world_bones(my_pose, wb);
//... do something with wb
//NOTE: no function to convert back.
WorldBones give you the absolute position of the base and tip of each bone along with the orientation of the bone's coordinate frame. This means you can think about bones without worrying about transforming them by their parents.
Displaying
============
#include <Character/Draw.hpp>
State no_state;
no_state.clear();
Character::draw(my_pose, no_state)
The draw function draws a pose at a given state (== additional absolute position + orientation for root bone). It gives a basic stovepipe-y character.
Motion Capture File Format:
The code base will read and display motion-captured data for you, but understanding the file format (.asf and .amc) is still very useful. The world coordinate system is Y up. The skeleton file (.asf) describes how the bones are connected, their degrees of freedom, their local coordinate system, etc. while the motion file (.amc) describes each bone's rotation angles relative to the bone's local coordinate system at each time step.
In an ASF file, each bone is described as following:
Video Recording:
Videos can be implemented in several ways. You can use the frame dumper (FrameDumper.hpp, FrameDumper.cpp in "Graphics" directory) in the code base by adding a hotkey to your program. These frames can be coalesced into a movie using software packages (ImageMagick and ffmpeg on Linux, Quicktime Pro on Mac, and VirtualDub on Windows). You can also use screen capture programs to record your videos.
2. Maya:
We will give you a rigged character with a basic walk cycle. You need to figure out how to make the motion more expressive by changing the key frames of the animation. You can work on changing the timing of it or just tweak the motion of the character. We will also provide you an animation guide which you can refer to.
You can download the .mb file here to start.
Before you open the file, please set Maya to Z-up. (Window->Settings/Preferences->Preferences->Settings, set the up axis to z.)
If you are not familiar enough with Maya, here is a basic tutorial. You can also click "Help"->"Maya Help" to get a thorough documentation.
Tips: